package com.example.demo.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.mapper.NewsMapper;
import com.example.demo.model.entity.NewsEntity;
import com.example.demo.model.param.NewsParam;
import com.example.demo.service.NewsService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class NewsServiceImpl extends ServiceImpl<NewsMapper,NewsEntity> implements NewsService {


    @Autowired
    private NewsMapper newsMapper;

    @Override
    public PageInfo selectNewsList(NewsParam newsParam) {
        PageHelper.startPage(newsParam.getPage(),newsParam.getLimit());
        List selectAppliers = newsMapper.selectNewsList(newsParam);
        PageInfo pageInfo = new PageInfo(selectAppliers);
        return pageInfo;
    }
}
